<!--
 * @Author: your name
 * @Date: 2022-03-08 10:26:32
 * @LastEditTime: 2022-03-08 21:50:01
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE!!
 * @FilePath: \JS\day08\3-操作结点.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .child{
            width: 100px;
            height: 100px;
            background-color: pink;
        }
    </style>
    <script>
     window.onload=function(){
         var parent=document.getElementsByClassName('parent')[0];

         var newchild=document.createElement('div');

         newchild.innerHTML='<div class="child">four</div>';

         parent.appendChild(newchild);
         console.log(parent);
         console.info(parent);
         console.debug(parent);
         console.error(parent);
         console.warn(parent)
     }
    </script>
</head>
<body>
    <div class="parent">
        <div class="child">1111</div>
        <div class="child">22222</div>
        <div class="child">33333</div>
        
    </div>
</body>
</html>